// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

import { SceneBase,framework,langMgr,packMgr,uiMgr,sceneMgr } from 'lcc';
import { _decorator,sys, Component } from 'cc';
const {ccclass, executeInEditMode, menu} = _decorator;

@ccclass('main/BootScene')
export default class BootScene extends Component {

    async start(){
        if(!framework.initialized){
            await framework.initialize();
            let lang = sys.localStorage.getItem('test.lang') || 'zh';
            await langMgr.setLanguage(lang);
        }
        await packMgr.loadPack('http://localhost:8000/remote/game');
        // sceneMgr.switchScene('game-scene');
        await packMgr.loadPack('http://localhost:8000/remote/test');
        sceneMgr.switchScene('test-scene');
    }
}
